<?php
include('function.php');

function calenderAbrufen(){
	
	$sql = "SELECT
				id
			FROM 
				global_event
			WHERE 
				event='" . $event . "' 
			AND 
				date='" . $date . "' ";
	
	$query = mysql_query($sql);
	$result = mysql_fetch_assoc($query);

}

function calenderHinzufuegen($event, $date){
	
	$sql = "SELECT
				id
			FROM 
				global_event
			WHERE 
				event='" . $event . "' 
			AND 
				date='" . $date . "' ";
	
	$query = mysql_query($sql);
	$result = mysql_fetch_assoc($query);

}

	$event = $_POST["event"];
	$date = $_POST["date"];

echo calenderHinzufuegen($event, $date);

	
	$eintrag = "INSERT INTO global_events (event,date) VALUES ('$event', '$date2')";

	$eintragen = mysql_query($eintrag);	
	
	/*	if(empty($result)) {
		$errorArray = array('bool' => false, 'message' => 'Benutzername oder Passwort falsch!');
		$jSonArray = json_encode($errorArray);
		return $jSonArray;
	} else {
		$_SESSION['user_id'] = $result['id'];
		$errorArray = array('bool' => true, 'message' => 'Login erfolgreich!', 'userId' => $_SESSION['user_id']);
		$jSonArray = json_encode($errorArray);
		return $jSonArray;
	}*/
?>
